package cl.smartdev.soagov.model;
import java.net.URI;
import java.net.URL;
import org.springframework.roo.addon.javabean.RooJavaBean;
import org.springframework.roo.addon.jpa.activerecord.RooJpaActiveRecord;
import org.springframework.roo.addon.tostring.RooToString;
import javax.persistence.ManyToOne;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;

@RooJavaBean
@RooToString
@RooJpaActiveRecord
public class Service {

    /**
     */
    @ManyToOne
    private ServiceStatus status;

    /**
     */
    private URI uri;

    /**
     */
    private URL nameSpace;

    /**
     */
    private String description;

    /**
     */
    @OneToMany(cascade = CascadeType.ALL,mappedBy = "service")
    private Set<Document> documents = new HashSet<Document>();

    /**
     */
    @OneToMany(cascade = CascadeType.ALL)
    private Set<ServiceOperation> operations = new HashSet<ServiceOperation>();

    /**
     */
    @OneToMany(cascade = CascadeType.ALL)
    private Set<ServiceComponent> backends = new HashSet<ServiceComponent>();

    /**
     */
    @OneToOne
    private IntegrationServer integrationServer;
}
